/**
 * @author: Niimp
 * @date: 2023/12/1 14:02
 * @statement:
 */
package com.dmgis.hndz.controller;

import com.alibaba.fastjson.JSONObject;
import com.dmgis.hndz.service.MonitoringManagementService;
import com.dmgis.hndz.common.result.HttpStatusEnum;
import com.dmgis.hndz.common.result.ResponseResult;
import com.dmgis.hndz.pojo.*;
import com.dmgis.hndz.pojoVo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "监测管理")
@RestController
@RequestMapping("/monitoringManagement")
public class MonitoringManagementController {

    @Autowired
    private MonitoringManagementService monitoringManagementService;

    @ApiOperation(value = "监测点信息查询")
    @PostMapping("/queryMonitorInfo")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "cityCode", value = "市编号", required = true, defaultValue = "431200", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countyCode", value = "县编号", required = false, defaultValue = "", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitoringCode", value = "监测点编号", required = false, defaultValue = "admin", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitoringName", value = "监测点名称", required = false, defaultValue = "admin", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "disasterType", value = "灾害类型", required = false, defaultValue = "admin", dataType = "String", paramType = "query"),
    })
    public ResponseResult queryMonitorInfo(@RequestBody JSONObject jsonObject) {
        List<Jcca16AVo> list = monitoringManagementService.queryMonitorInfo(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }



    @ApiOperation(value = "监测点传感器查询")
    @PostMapping("/queryMonitorAndSensorInfo")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "currentPage", value = "当前页", required = true, defaultValue = "01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "pageSize", value = "页面大小", required = true, defaultValue = "10", dataType = "String", paramType = "query"),
    })
    public ResponseResult queryMonitorAndSensorInfo(@RequestBody JSONObject jsonObject) {
        List<MonitorAndSensorVo> list = monitoringManagementService.queryMonitorAndSensorInfo(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }



    @ApiOperation(value = "报警信息查询")
    @PostMapping("/queryMonitorWaringInfo")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = true, defaultValue = "2023-11-09 17:45:19", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-11-09 19:01:01.698", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-11-10 20:31:55.759", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "waringLevel", value = "预警等级(1：红，2：橙、3：黄、4：蓝)", required = false, defaultValue = "", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "waringStatus", value = "预警状态1:有 0:无", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(日、周、月、年)", required = false, defaultValue = "日", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "jcdId", value = "监测点编号", required = true,  dataType = "String", paramType = "query"),

    })
    public ResponseResult queryMonitorWaringInfo(@RequestBody JSONObject jsonObject) {
        MonitorWaringInfoVo list = monitoringManagementService.queryMonitorWaringInfo(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线-地表位移")
    @PostMapping("/queryDetectionCurveSurfaceDisplacement")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 09:32:00", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 08:00:00", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-06 09:36:09", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "431123011160", dataType = "String", paramType = "query")
    })
    public ResponseResult queryDetectionCurveSurfaceDisplacement(@RequestBody JSONObject jsonObject) {
        DetectionCurveResultVo list = monitoringManagementService.queryDetectionCurve(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线-加速度")
    @PostMapping("/queryDetectionCurveAcceleration")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 12:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 12:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-06 14:53:14", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430725021159", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveAcceleration(@RequestBody JSONObject jsonObject) {
        DetectionCurveAccelerationResultVo list = monitoringManagementService.queryDetectionCurveAcceleration(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线-倾角")
    @PostMapping("/queryDetectionCurveDipAngle")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 00:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-06 11:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430581011262", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveDipAngle(@RequestBody JSONObject jsonObject) {
        DetectionCurveDipAngleResultVo list = monitoringManagementService.queryDetectionCurveDipAngle(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }

    @ApiOperation(value = "监测曲线-雨量")
    @PostMapping("/queryDetectionCurveRainfall")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-06 12:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-09 18:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "431322001397", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveRainfall(@RequestBody JSONObject jsonObject) {
        DetectionCurveRainfallResultVo list = monitoringManagementService.queryDetectionCurveRainfall(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线-气温")
    @PostMapping("/queryDetectionCurveAirTemperature")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 12:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-05 14:53:14", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "431322001397", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveAirTemperature(@RequestBody JSONObject jsonObject) {
        List<Jcaa12a> list = monitoringManagementService.queryDetectionCurveAirTemperature(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }

    @ApiOperation(value = "监测曲线-裂缝")
    @PostMapping("/queryDetectionCurveCrack")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 12:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-05 14:53:14", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430382031094", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveCrack(@RequestBody JSONObject jsonObject) {
        TwoStringListVo list = monitoringManagementService.queryDetectionCurveCrack(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 土壤含水率")
    @PostMapping("/queryDetectionCurveSoilMoistureContent")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 12:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-05 14:53:14", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430382031094", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveSoilMoistureContent(@RequestBody JSONObject jsonObject) {
        List<Jcaa14a> list = monitoringManagementService.queryDetectionCurveSoilMoistureContent(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 泥水位")
    @PostMapping("/queryDetectionCurveMudWaterLevel")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-05 12:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-05 14:53:14", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430382031094", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveMudWaterLevel(@RequestBody JSONObject jsonObject) {
        List<Jcaa22a> list = monitoringManagementService.queryDetectionCurveMudWaterLevel(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }



    @ApiOperation(value = "监测曲线- 气压")
    @PostMapping("/queryDetectionCurvePressure")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2021-10-30 07:00:00", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2021-10-31 22:00:00", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "430923001298", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "1", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurvePressure(@RequestBody JSONObject jsonObject) {
        List<Jcaa21a> list = monitoringManagementService.queryDetectionCurvePressure(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 振动")
    @PostMapping("/queryDetectionCurveVibrate")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2021-07-02 00:00:49", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2021-07-02 23:50:55", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430923011065", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveVibrate(@RequestBody JSONObject jsonObject) {
        DetectionCurveCrackListVo list = monitoringManagementService.queryDetectionCurveVibrate(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 深度位移")
    @PostMapping("/queryDetectionCurveDeepDisplacement")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-07 12:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-09 18:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "431382040035", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveDeepDisplacement(@RequestBody JSONObject jsonObject) {
        DetectionCurveDeepDisplacementResultVo list = monitoringManagementService.queryDetectionCurveDeepDisplacement(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 土压力")
    @PostMapping("/queryDetectionCurveSoilPressure")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-07 12:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-09 18:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430321011127", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveSoilPressure(@RequestBody JSONObject jsonObject) {
        List<Jcaa08a> list = monitoringManagementService.queryDetectionCurveSoilPressure(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 土壤温度")
    @PostMapping("/queryDetectionCurveSoilTempera")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-07 12:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-09 18:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430725011030", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveSoilTempera(@RequestBody JSONObject jsonObject) {
        List<Jcaa13a> list = monitoringManagementService.queryDetectionCurveSoilTempera(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }

    @ApiOperation(value = "监测曲线- 地下水位水温")
    @PostMapping("/queryDetectionCurveUndergroundWaterLevelTempera")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-07 12:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-09 18:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430923019013", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurveUndergroundWaterLevelTempera(@RequestBody JSONObject jsonObject) {
        DetectionCurveUndergroundWaterLevelTemperaResultVo list = monitoringManagementService.queryDetectionCurveUndergroundWaterLevelTempera(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "监测曲线- 孔隙水压力监测")
    @PostMapping("/queryDetectionCurvePoreWaterPressure")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false, defaultValue = "2023-12-05 14:00:01", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "startTime", value = "开始时间", required = false, defaultValue = "2023-12-07 12:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "endTime", value = "结束时间", required = false, defaultValue = "2023-12-09 18:00:02", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "dateLevel", value = "日期等级(1日、3日、7日、15日、30日)", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "countLevel", value = "实时:任意 小时:2 天:3 月:4", required = false, defaultValue = "1", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "430822011119", dataType = "String", paramType = "query")

    })
    public ResponseResult queryDetectionCurvePoreWaterPressure(@RequestBody JSONObject jsonObject) {
        DetectionCurvePoreWaterPressureResultVo list = monitoringManagementService.queryDetectionCurvePoreWaterPressure(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "预警模型")
    @PostMapping("/queryWaringModel")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "singleOrMultipleParameters", value = "单参数or多参数 0/1", required = false, defaultValue = "0", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "warningFrequency", value = "预警频率", required = false, defaultValue = "24", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = false, defaultValue = "431102010230", dataType = "String", paramType = "query")

    })
    public ResponseResult queryWaringModel(@RequestBody JSONObject jsonObject) {
        List<WaringModelVo> list = monitoringManagementService.queryWaringModel(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", list);
    }


    @ApiOperation(value = "表达式更新")
    @PostMapping("/updateExpression")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = true, defaultValue = "433130039002", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "monitorExpression", value = "表达式", required = true,
                    defaultValue = "4331300390020301YL01(雨量)蓝色预警 且 ( 4331300390020201NW01(泥水位)蓝色预警 )", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "waringType", value = "预警类型蓝4黄3橙2红1", required = false, defaultValue = "4", dataType = "String", paramType = "query"),
    })
    public ResponseResult updateExpression(@RequestBody JSONObject jsonObject) {
        try {
            int result = monitoringManagementService.updateExpression(jsonObject);
            if (result > 0) {
                return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true,"更新成功", result);
            } else {
                return new ResponseResult(HttpStatusEnum.ERROR.getCode(),false, "更新失败",result);
            }
        } catch (Exception e) {
            throw new RuntimeException("更新操作发生异常", e);
        }
    }



    @ApiOperation(value = "表达式删除")
    @PostMapping("/deleteExpression")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "monitorCode", value = "监测点编码", required = true, defaultValue = "433130039002", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "waringType", value = "预警类型蓝4黄3橙2红1", required = false, defaultValue = "4", dataType = "String", paramType = "query"),
    })
    public ResponseResult deleteCriterionDelete(@RequestBody JSONObject jsonObject) {
        try {
            int result = monitoringManagementService.deleteCriterionDelete(jsonObject);
            if (result > 0) {
                return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true,"删除成功", result);
            } else {
                return new ResponseResult(HttpStatusEnum.ERROR.getCode(),false, "删除失败",result);
            }
        } catch (Exception e) {
            throw new RuntimeException("删除操作发生异常", e);
        }
    }


}


